<?php


namespace app\live\controller\sys_admin;


use app\AdminController;
use app\mainadmin\model\SettingsModel;

class Setting extends AdminController
{

    public function initialize($isretrun = true)
    {
        parent::initialize($isretrun);
        $this->Model = new SettingsModel();
    }

    public function index(){
        $setting = $this->Model->getRows();
        $this->assign("setting",$setting);
        return $this->fetch();
    }

    public function save(){
        $set = input('post.');
        $res = $this->Model->editSave($set);
        if ($res == false) return $this->error();
        return $this->success('设置成功.');
    }

}